#include<bits/stdc++.h>

using namespace std;


int main() {
    vector<int> v = {1, 2, 3, 4};
    for (int i = 0; i < v.size(); i++) {
        cout << v[i] << " ";
    }
    cout << endl;
    for (auto e:v) {
        cout << e << " ";
    }
    cout << endl;


    for_each(v.begin(), v.end(), [](int x) -> void {
        cout << x << " ";
    });
    cout << endl;


}